1 =============================================================================
2 CSASPNETuserControlEventsExpose Overview
3 =============================================================================
5 /////////////////////////////////////////////////////////////////////////////
8 The project illustrates how to bubble an event from Web User Control to the
9 web page that may display something on Web Page according to which event is
10 fired in this User control.
13 /////////////////////////////////////////////////////////////////////////////
16 Click the CSASPNETuserControlEventsExpose.sln directly and open the
17 CSASPNETuserControlEventsExpose website to test the page directly.
19 If you want to have a further test, please follow the demonstration steps
22 Step 1: View the Default.aspx,you will find some Controls,select the
25 Step 2: When click the the button control whose value is 'I am inside User
28 The webpage custom event will fire, display the dropdownlist selected value
29 and inform user the usercontrol's button click is clicked.
32 /////////////////////////////////////////////////////////////////////////////
35 Step 1. Declare a delagate and a event in the user control code behind,
36 add one button to this User Control.
38 Step 2. Add the following lines of code in the click event of button of
43 this.MyEvent(sender, e);
45 Response.Write("User Control¡¯s Button Click <BR/>");
47 Step 3. In the Default.aspx.cs file,Load the usercontrol, and subscribe the
48 event of the user control in the page load event.
50 Step 4. Define a suitable event handler to display the dropdownlist selected
54 /////////////////////////////////////////////////////////////////////////////
57 MSDN: Events and Delegates
58 http://msdn.microsoft.com/en-us/library/17sde2xt(VS.71).aspx
61 http://forums.asp.net/t/1360420.aspx
63 Catch event from Web User Control in Webpage
64 http://devcandy.blogspot.com/2008/06/catch-event-from-web-user-control-in.html
67 /////////////////////////////////////////////////////////////////////////////